package com.ak.server.quartz.entity;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.ak.common.utils.TimeConverter;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.ExcelField;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 定时任务调度日志表 sys_job_log
 *
 * @author Vean
 */
@Data
@TableName("sys_job_log")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysJobLog implements Serializable {

	private static final long serialVersionUID = 2227535272311086566L;

	/**
     * ID
     */
	@TableId(value = "job_log_id", type = IdType.UUID)
    private String jobLogId;

    /**
     * 任务名称
     */
    private String jobName;

    /**
     * 任务组名
     */
    private String jobGroup;

    /**
     * 调用目标字符串
     */
    private String invokeTarget;

    /**
     * 日志信息
     */
    private String jobMessage;
    
    @ExcelField(name = "状态", readConverterExp = "0=正常,1=失败")
    private String status;

    /**
     * 异常信息
     */
    private String exceptionInfo;
    
    @ExcelField(value = "创建时间", writeConverter = TimeConverter.class)
    private Date createTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("jobLogId", getJobLogId())
                .append("jobName", getJobName())
                .append("jobGroup", getJobGroup())
                .append("invokeTarget", getInvokeTarget())
                .append("jobMessage", getJobMessage())
                .append("status", getStatus())
                .append("exceptionInfo", getExceptionInfo())
                .append("createTime", getCreateTime())
                .toString();
    }
}
